有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

安卓全新应用程序在R.java中抛出“语法错误,插入“}”以完成类体”

我刚刚在Eclipse中创建了一个新项目,R.java在最后一个分号上显示了“语法错误,插入“}”以完成类体”

我仔细检查了所有XML文件中的错误、步骤错误、拼写错误和空参数,但没有结果

下面是R.java中引发错误的最后几行代码

            public static final int View_安卓_focusable = 0;
    /**
      <p>
      @attr description
       Sets the padding, in pixels, of the end edge; see {@link 安卓.R.attr#padding}. 


      <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
    Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
 "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
      <p>This is a private symbol.
      @attr name com.example.reignofgodsplayer:paddingEnd
    */
    public static final int View_paddingEnd = 2;
    /**
      <p>
      @attr description
       Sets the padding, in pixels, of the start edge; see {@link 安卓.R.attr#padding}. 


      <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp     (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
 theme attribute (in the form
 "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
 containing a value of this type.
      <p>This is a private symbol.
      @attr name com.example.reignofgodsplayer:paddingStart
    */
    public static final int View_paddingStart = 1;
};

共 (2) 个答案

  1. # 1 楼答案

    转到gen > android.v7.appcompat包,然后复制R.java 并将其替换为默认包中现有的R.java

  2. # 2 楼答案

    当我在项目中将“target=android-20”更改为“target=android-23”时,我会遇到与您相同的问题。属性文件。如果我找回它。没问题。 所以您需要尝试修改“target=android-20”项目。属性文件,也许是一个好方法